1. Field of the Invention
The present invention relates to a master/slave communication system in which one master is connected to multiple slaves through a serial transmission line, and control data is exchanged between the master and the slaves in a predetermined communication period.
2. Description of Related Art
Generally in a manufacturing apparatus, a control device such as a programmable logic controller (PLC) or a personal computer functions as a master, and multiple slave devices such as a sensor, a relay, and a motor periodically exchange control data with the master. At a manufacturing site, control data may often be damaged on the transmission line due to, for example, noise generated from a machine or a relay device. Therefore, re-execution of exchange of control data is needed as means for enhancing the transmission reliability. Exchange of control data is used to mean both sending of command data from the master to a slave and receiving of response data from the slave.
In a scheme where exchange of control data is re-executed individually for each slave (hereinafter simply stated as resending), if the number of slaves for which resending is to be performed increases, the communication period is exceeded, and the communication period fluctuates. Thus, a communication period with sufficient margin for allowing resending to be performed for all the slaves is set in advance.
For example, it is proposed in Japanese Unexamined Patent Application Publication No. 08-033070 for a master to have a resending counter for each slave and a resending total counter that counts the total number of times resending is performed. In this proposal, resending is performed when the count value of the resending counter is less than or equal to a limit value set in advance for each slave, and when the count value of the resending total counter is also less than or equal to a preset limit value.